import { Asset, AssetManager, assetManager, path, Prefab, } from "cc";


export class AssetMag {
    static loadPrefab(url: string): Promise<Prefab> {
        return new Promise((resolve, reject) => {
            assetManager.loadBundle("Prefab", (err, bundle) => {
                bundle.load(`${url}`, Prefab, (err, prefab) => {
                    if (err) {
                        reject(err);
                    } else {
                        resolve(prefab);
                    }
                });
            });

        });
    }

}
